package cn.getech.data.metadata.model.res;

import cn.getech.data.metadata.entity.meta.CollectionTaskLog;
import cn.getech.data.metadata.model.res.log.TableLog;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.Map;

@ApiModel(description = "采集信息详情")
@Data
public class CollectionTaskLogDetail {
    public CollectionTaskLogDetail() {
    }
    public CollectionTaskLogDetail(CollectionTaskLog record) {
        this.id = record.getId();
        this.version = record.getVersion();
        this.taskName = record.getTaskName();
        this.taskType = record.getTaskType();
        this.ownSystem = record.getOwnSystem();
        this.ownModule = record.getOwnModule();
        this.updateUser = record.getUpdateUser();
        this.createTime = record.getCreateTime();
        this.updateTime = record.getUpdateTime();
    }

    private Long id;
    private String version;
    /**
     * 任务名称
     */
    @ApiModelProperty(value = "任务名称")
    private String taskName;
    /**
     * 0 手动采集 1自动采集
     */
    @ApiModelProperty(value = "采集类型 0 手动采集 1自动采集")
    private Integer taskType;

    /**
     * 所属系统id
     */
    private Integer ownSystem;
    @ApiModelProperty(value = "所属系统")
    private String ownSystemName;
    /**
     * 所属模块id
     */
    private Integer ownModule;
    @ApiModelProperty(value = "所属模块")
    private String ownModuleName;
    /**
     * 更新人
     */
    private Long updateUser;
    @ApiModelProperty(value = "更新人")
    private String updateUserName;

    /**
     * 模块负责人
     */
    @ApiModelProperty(value = "模块负责人")
    private String moduleUserName;
    /**
     * 任务执行人
     */
    @ApiModelProperty(value = "任务执行人")
    private String runLeaderName;
    /**
     * 任务负责人
     */
    @ApiModelProperty(value = "任务负责人")
    private String taskLeaderName;
    /**
     * 资源信息
     */
    @ApiModelProperty(value = "资源信息")
    private Map<String,Object> resource;

    /**
     * 采集日期
     */
    @ApiModelProperty(value = "采集日期")
    private Date createTime;
    /**
     * 更新日期
     */
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;

    @ApiModelProperty(value = "数据源")
    private List<CollectionTaskLogSource> sources;

    @ApiModelProperty(value = "调度方式 1:正常 2:暂停")
    private Integer scheduleEnable;
    @ApiModelProperty(value = "循环方式 1:定时运行 2:循环运行")
    private Integer scheduleMode;
    @ApiModelProperty(value = "调度单位 循环方式为循环运行 1:每小时 2:每日 3:每周 4:每月 ")
    private Integer scheduleUnit;
    @ApiModelProperty(value = "循环方式间隔 调度方式值")
    private Integer intervalValue;

    @ApiModelProperty(value = "循环方式定时 分")
    private Integer scheduleMinute;
    @ApiModelProperty(value = "循环方式定时 时")
    private Integer scheduleHour;
    @ApiModelProperty(value = "循环方式定时 天或者周")
    private Integer scheduleDay;

    @ApiModelProperty(value = "数据源类型")
    private String sourceType;

    @ApiModelProperty(value = "初始化角色")
    private String roleName;

    @ApiModelProperty(value = "采集日志")
    private String logContent;
    @ApiModelProperty(value = "添加的表")
    private List<TableLog> addTableList = Lists.newArrayList();
    @ApiModelProperty(value = "修改的表")
    private List<TableLog> updateTableList = Lists.newArrayList();
    @ApiModelProperty(value = "删除的表")
    private List<TableLog> deleteTableList = Lists.newArrayList();
    @ApiModelProperty(value = "没有变化的表")
    private List<TableLog> noneTableList = Lists.newArrayList();
}
